package defpackage; import cn.wps.moffice.common.beans.DynamicLinearLayout; import com.google.gson.reflect.TypeToken; import com.iflytek.cloud.SpeechEvent; import com.iflytek.cloud.SpeechUtility; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.json.JSONObject; /* renamed from: gow reason: default package */ public final class gow { protected DynamicLinearLayout gRX; protected gov hrp; protected String hrq; protected String hrr; protected boolean hrs = true; protected String hrt; public gow(DynamicLinearLayout dynamicLinearLayout) { this.gRX = dynamicLinearLayout; if (this.gRX != null) { this.hrp = new gov(this.gRX.getContext()); this.gRX.setAdapter(this.hrp); } fno bBh = fok.bBq().geJ.bBh(); this.hrr = fok.bBq().getWPSSid(); if (!(bBh == null || bBh.gcz == null)) { this.hrq = bBh.gcz.toString() + this.hrr; } this.hrt = String.valueOf(huo.BH("ads_free_cn")) + String.valueOf(huo.BH("pdf")); } public final void update() { boolean z = false; if (ebo.arU() && this.gRX != null) { fno bBh = fok.bBq().geJ.bBh(); String str = null; String wPSSid = fok.bBq().getWPSSid(); if (!(bBh == null || bBh.gcz == null)) { str = bBh.gcz.toString() + wPSSid; } String str2 = String.valueOf(huo.BH("ads_free_cn")) + String.valueOf(huo.BH("pdf")); boolean z2 = this.hrt != null && !this.hrt.equals(str2); boolean z3 = this.hrq != null && !this.hrq.equals(str); if (this.hrs || z2 || z3) { this.hrs = false; this.hrq = str; this.hrt = str2; z = true; } } if (z) { fcx.p(new Runnable() { /* class defpackage.gow.AnonymousClass1 */ public final void run() { try { HashMap hashMap = new HashMap(); hashMap.put("cookie", "wps_sid=" + fok.bBq().getWPSSid()); JSONObject jSONObject = new JSONObject(lwd.f("https://vipapi.wps.cn/v2/vip_center/my/privilege", hashMap)); if ("ok".equals(jSONObject.optString(SpeechUtility.TAG_RESOURCE_RESULT))) { List list = (List) lvb.b(jSONObject.optString(SpeechEvent.KEY_EVENT_RECORD_DATA), new TypeToken<List<String>>() { /* class defpackage.gow.AnonymousClass1.AnonymousClass1 */ }.getType()); gow gow = gow.this; if (list != null) { fzc.bJM().y(new Runnable(list) { /* class defpackage.gow.AnonymousClass2 */ final /* synthetic */ List hrw; { this.hrw = r2; } public final void run() { ArrayList arrayList = new ArrayList(); for (String str : this.hrw) { if ("no_ad".equals(str) || "pdf2word".equals(str)) { arrayList.add(str); } } gow.this.hrp.setData(arrayList); gow.this.hrp.notifyDataSetChanged(); } }); } } } catch (Exception e) { } } }); } } }